3.1.84 \(\int \frac {1}{1+\pi x+2 x^2} \, dx\) [84]

Optimal. Leaf size=27 \[ -\frac {2 \tanh ^{-1}\left (\frac {\pi +4 x}{\sqrt {-8+\pi ^2}}\right )}{\sqrt {-8+\pi ^2}} \]

[Out]

-2*arctanh((Pi+4*x)/(Pi^2-8)^(1/2))/(Pi^2-8)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {632, 212} \begin {gather*} -\frac {2 \tanh ^{-1}\left (\frac {4 x+\pi }{\sqrt {\pi ^2-8}}\right )}{\sqrt {\pi ^2-8}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + Pi*x + 2*x^2)^(-1),x]

[Out]

(-2*ArcTanh[(Pi + 4*x)/Sqrt[-8 + Pi^2]])/Sqrt[-8 + Pi^2]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \frac {1}{1+\pi x+2 x^2} \, dx &=-\left (2 \text {Subst}\left (\int \frac {1}{-8+\pi ^2-x^2} \, dx,x,\pi +4 x\right )\right )\\ &=-\frac {2 \tanh ^{-1}\left (\frac {\pi +4 x}{\sqrt {-8+\pi ^2}}\right )}{\sqrt {-8+\pi ^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 27, normalized size = 1.00 \begin {gather*} -\frac {2 \tanh ^{-1}\left (\frac {\pi +4 x}{\sqrt {-8+\pi ^2}}\right )}{\sqrt {-8+\pi ^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + Pi*x + 2*x^2)^(-1),x]

[Out]

(-2*ArcTanh[(Pi + 4*x)/Sqrt[-8 + Pi^2]])/Sqrt[-8 + Pi^2]

________________________________________________________________________________________

Maple [A]
time = 0.52, size = 24, normalized size = 0.89

method result size
default \(-\frac {2 \arctanh \left (\frac {\pi +4 x}{\sqrt {\pi ^{2}-8}}\right )}{\sqrt {\pi ^{2}-8}}\) \(24\)
risch \(\frac {\ln \left (-\pi ^{2}+\pi \sqrt {\pi ^{2}-8}+4 x \sqrt {\pi ^{2}-8}+8\right )}{\sqrt {\pi ^{2}-8}}-\frac {\ln \left (\pi ^{2}+\pi \sqrt {\pi ^{2}-8}+4 x \sqrt {\pi ^{2}-8}-8\right )}{\sqrt {\pi ^{2}-8}}\) \(71\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(Pi*x+2*x^2+1),x,method=_RETURNVERBOSE)

[Out]

-2*arctanh((Pi+4*x)/(Pi^2-8)^(1/2))/(Pi^2-8)^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 38, normalized size = 1.41 \begin {gather*} \frac {\log \left (\frac {\pi + 4 \, x - \sqrt {\pi ^{2} - 8}}{\pi + 4 \, x + \sqrt {\pi ^{2} - 8}}\right )}{\sqrt {\pi ^{2} - 8}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x+2*x^2+1),x, algorithm="maxima")

[Out]

log((pi + 4*x - sqrt(pi^2 - 8))/(pi + 4*x + sqrt(pi^2 - 8)))/sqrt(pi^2 - 8)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (23) = 46\).
time = 1.92, size = 50, normalized size = 1.85 \begin {gather*} \frac {\log \left (\frac {\pi ^{2} + 4 \, \pi x + 8 \, x^{2} - {\left (\pi + 4 \, x\right )} \sqrt {\pi ^{2} - 8} - 4}{\pi x + 2 \, x^{2} + 1}\right )}{\sqrt {\pi ^{2} - 8}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x+2*x^2+1),x, algorithm="fricas")

[Out]

log((pi^2 + 4*pi*x + 8*x^2 - (pi + 4*x)*sqrt(pi^2 - 8) - 4)/(pi*x + 2*x^2 + 1))/sqrt(pi^2 - 8)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (26) = 52\).
time = 0.10, size = 76, normalized size = 2.81 \begin {gather*} \frac {\log {\left (x - \frac {\pi ^{2}}{4 \sqrt {-8 + \pi ^{2}}} + \frac {\pi }{4} + \frac {2}{\sqrt {-8 + \pi ^{2}}} \right )}}{\sqrt {-8 + \pi ^{2}}} - \frac {\log {\left (x - \frac {2}{\sqrt {-8 + \pi ^{2}}} + \frac {\pi }{4} + \frac {\pi ^{2}}{4 \sqrt {-8 + \pi ^{2}}} \right )}}{\sqrt {-8 + \pi ^{2}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x+2*x**2+1),x)

[Out]

log(x - pi**2/(4*sqrt(-8 + pi**2)) + pi/4 + 2/sqrt(-8 + pi**2))/sqrt(-8 + pi**2) - log(x - 2/sqrt(-8 + pi**2)
+ pi/4 + pi**2/(4*sqrt(-8 + pi**2)))/sqrt(-8 + pi**2)

________________________________________________________________________________________

Giac [A]
time = 0.71, size = 40, normalized size = 1.48 \begin {gather*} \frac {\log \left (\frac {{\left | \pi + 4 \, x - \sqrt {\pi ^{2} - 8} \right |}}{{\left | \pi + 4 \, x + \sqrt {\pi ^{2} - 8} \right |}}\right )}{\sqrt {\pi ^{2} - 8}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(pi*x+2*x^2+1),x, algorithm="giac")

[Out]

log(abs(pi + 4*x - sqrt(pi^2 - 8))/abs(pi + 4*x + sqrt(pi^2 - 8)))/sqrt(pi^2 - 8)

________________________________________________________________________________________

Mupad [B]
time = 0.36, size = 23, normalized size = 0.85 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\frac {\Pi +4\,x}{\sqrt {\Pi ^2-8}}\right )}{\sqrt {\Pi ^2-8}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(Pi*x + 2*x^2 + 1),x)

[Out]

-(2*atanh((Pi + 4*x)/(Pi^2 - 8)^(1/2)))/(Pi^2 - 8)^(1/2)

________________________________________________________________________________________